﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace EthnicEdu.Pages
{
    public partial class Questions : PhoneApplicationPage
    {
        public Questions()
        {
            InitializeComponent();
            App.myService.GetAllQuestionByCategoryIdAsync(App.CategoryID);
            App.myService.GetAllQuestionByCategoryIdCompleted += new EventHandler<Service.GetAllQuestionByCategoryIdCompletedEventArgs>(myService_GetAllQuestionByCategoryIdCompleted);
            
            
      
        }

        void myService_GetAllQuestionByCategoryIdCompleted(object sender, Service.GetAllQuestionByCategoryIdCompletedEventArgs e)
        {
            this.DataContext = App.ListQuestion =  e.Result;

        }

        private void StackPanel_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            App.SelectQuestionIndex = lsQuestion.SelectedIndex;

            NavigationService.Navigate(new Uri("/Pages/ViewerQuestion.xaml", UriKind.Relative));
        }
       
    }
}